.messages-view {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;

  .loading-full {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1;
    .loading {
      position: absolute;
      margin: auto;
      width: 50px;
      height: 50px;
      right: 0px;
      bottom: 0px;
      top: 0px;
      left: 0px;
    }
  }

  .messages-scroller-parent {
    flex: 1;
    min-height: 0;
    position: relative;

    &:before {
      content: '';
      position: absolute;
      width: 100%;
      height: 0px;
      background: var(--white);
      border-top: 1px solid transparent;
      z-index: 4;
      bottom: 0;
      pointer-events: none;
      transition: height 0.2s;
    }
    &:after {
      content: '';
      position: absolute;
      width: 100%;
      height: 100%;
      box-shadow: 0 -16px 8px -8px rgba(255, 255, 255, 0) inset;
      z-index: 4;
      bottom: 8px;
      pointer-events: none;
      transition: box-shadow 0.2s, bottom 0.2s;
    }
    &.scrolled-up-100 {
      &:after,
      &:before {
        opacity: 1;
      }
      &:before {
        border-top: 1px solid var(--grey-background);
        height: 16px;
      }
      &:after {
        bottom: 16px;
        box-shadow: 0 -32px 32px -32px rgba(0, 0, 0, 0.1) inset;
      }
    }
    &.scrolled-up {
      &:after {
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        box-shadow: 0 -16px 8px -8px rgba(255, 255, 255, 1) inset;
        z-index: 4;
        bottom: 0px;
        pointer-events: none;
        transition: box-shadow 0.2s, bottom 0.2s;
      }
    }

    .message_header {
      margin-top: 16px;
    }

    .go-to-now {
      position: absolute;
      padding: 0 8px;
      bottom: 32px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 4;
      font-size: 14px;
      color: var(--white);
      align-items: center;
      justify-content: center;
      display: flex;
      flex-direction: row;
      background-color: var(--primary);
      height: 28px;
      width: auto;
      border-radius: 14px;
      box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
      cursor: pointer;
      transition: opacity 0.2s;
      opacity: 1;
    }

    &:not(.scrolled-up-100) {
      .go-to-now {
        pointer-events: none;
        opacity: 0;
      }
    }
  }

  .thread .message_timeline {
    text-align: left;
    background: var(--white);
    margin-left: 0px;
    margin-top: -12px;
    width: 100%;
    .time_container {
      margin-left: 32px;
    }
    &::before {
      margin-top: 21px;
    }
  }

  .message_timeline {
    text-align: center;
    color: var(--grey-dark);
    font-size: 12px;
    position: relative;
    height: 22px;
    margin: 0 auto;
    margin-bottom: 12px;
    margin-top: 20px;
    min-width: 0;
    max-width: 1000px;
    width: calc(100% - 32px);

    &::before {
      content: '';
      z-index: 0;
      width: 100%;
      border-bottom: 1px solid var(--grey-background);
      position: relative;
      left: 0;
      margin-top: 11px;
      display: inline-block;
    }

    &.new_messages {
      &::before {
        border-color: var(--primary);
      }
      .time_container {
        .time {
          font-weight: 700;
          background: var(--white);
          color: var(--primary);
        }
      }
    }

    .time_container {
      display: inline-block;
      padding: 0px 11px;
      background: var(--white);
      top: -15px;
      position: relative;

      .time {
        color: var(--grey-dark);
        width: auto;
        z-index: 1;
        height: 22px;
        line-height: 22px;
        margin: auto;
        font-size: 12px;
        border-radius: 12px;
        padding: 0 4px;
      }
    }
  }

  .writing_message {
    font-size: 12px;
    color: var(--grey-dark);
    font-size: 12px;
    padding-bottom: 8px;
    position: absolute;
    bottom: 0;
    left: 0;
    margin: auto;
    right: 0;
    width: calc(100% - 48px);
    background: #fff;
    transition: opacity 0.2s;
    min-width: 0;
    max-width: 1000px;
    width: calc(100% - 32px);

    &:hover {
      opacity: 0.2;
    }
  }
}
